package com.javandad.app.client.searchComponent;

import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import com.javandad.app.shared.entity.search.SearchProperties;

abstract class Search {
	
	protected TextBox freetextSearchTerm;
	
	public Search(TextBox freetext) {
		freetextSearchTerm = freetext;
	}
	
	public Widget getAdvancedOptions()
	{
		// null means this kind of search doesn't have any advanced options
		return null;
	}
	
	public abstract SearchProperties getSearchProperties() throws InvalidArgumentException;
	
	public abstract String getSearchName();

	class InvalidArgumentException extends Exception {

		private static final long serialVersionUID = 4708182116402939238L;

		public InvalidArgumentException() {
			super();
		}

		public InvalidArgumentException(String message, Throwable cause) {
			super(message, cause);
		}

		public InvalidArgumentException(Throwable cause) {
			super(cause);
		}

		public InvalidArgumentException(String message) {
			super(message);
		}

	}
}